﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Helper.Infrastructure.Call;
using Helper.Infrastructure.Extensions;

namespace Helper.Metadata
{
    [MetadataType(typeof(FilterCallMetadata))]

    public partial class FilterCall { }

    public class FilterCallMetadata
    {
        private DateTime _initialDate, _finalDate;
        

        public FilterCallMetadata()
        {
            _initialDate = DateTime.Now;
            _finalDate = DateTime.Now;
        }

        [Display(Name="Nome do usuário")]
        public string Username { get; set; }

        [Display(Name="Empresa")]
        public string Businessname { get; set; }

        [Display(Name="Data Inicial")]
        [DataType(DataType.Date)]        
        public DateTime InitialDate { get { return _initialDate.RemoveAllTime(); } set { _initialDate = value;  } }

        [Display(Name="Data Final")]
        [DataType(DataType.Date)]        
        public DateTime FinalDate { get { return _finalDate.SetTimeTop(); } set { _finalDate = value; } }
    }
}